package co.fitstart.entity.market;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import co.fitstart.entity.user.User;

/**
 * 分享二维码
 * 
 * @author dan
 *
 */
@Entity
@Table(name = "participation_qrcode")
@JsonIgnoreProperties(value={"hibernate_lazy_initializer","handler","fieldHandler"})
public class ParticipationQrcode {
    
    @Id
    @GeneratedValue
    private Long id;
    
    /** 二维码 */
    private String qrcode;
    
    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    private User user;
    
    /** 是否为签到分享二维码 
     * true：签到分享二维码 
     * false：开启课程分享二维码 
     **/
    private boolean signin;
    
    @Column(name = "is_disabled")
    private boolean disabled;
    
    /**
     * The default constructor
     */
    public ParticipationQrcode() {
        
    }
    
    /**
     * 
     * @param qrcode
     * @param signin
     * @param user
     */
    public ParticipationQrcode(String qrcode, boolean signin, User user) {
        this.qrcode = qrcode;
        this.signin = signin;
        this.user = user;
        this.disabled = false;
    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @return the qrcode
     */
    public String getQrcode() {
        return qrcode;
    }

    /**
     * @return the user
     */
    public User getUser() {
        return user;
    }

    /**
     * @return the signin
     */
    public boolean isSignin() {
        return signin;
    }

    /**
     * @return the disabled
     */
    public boolean isDisabled() {
        return disabled;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @param qrcode the qrcode to set
     */
    public void setQrcode(String qrcode) {
        this.qrcode = qrcode;
    }

    /**
     * @param user the user to set
     */
    public void setUser(User user) {
        this.user = user;
    }

    /**
     * @param signin the signin to set
     */
    public void setSignin(boolean signin) {
        this.signin = signin;
    }

    /**
     * @param disabled the disabled to set
     */
    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }

}
